package easycloud.ecs.web.service;

import javax.inject.Inject;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import easycloud.ecs.common.domain.Folder;
import easycloud.ecs.common.repository.FolderRepository;

@Service
@Transactional(readOnly = true)
public class FolderService {

	private static final Log logger = LogFactory.getLog(FolderService.class);
	
	@Inject
	private FolderRepository folderRepository;

	@Transactional(readOnly = false)
	public void save(Folder folder) {
		folderRepository.save(folder);
	}

	public Folder getFolder(Integer folderid) {
		return folderRepository.findOne(folderid);
	}

	@Transactional(readOnly = false)
	public void delete(Folder folder) {
		folderRepository.delete(folder);
	}

}
